package com.yonyou.ncmm_pac_pda;

import com.yonyou.uap.um.application.ApplicationContext;
import com.yonyou.uap.um.base.*;
import com.yonyou.uap.um.common.*;
import com.yonyou.uap.um.third.*;
import com.yonyou.uap.um.control.*;
import com.yonyou.uap.um.core.*;
import com.yonyou.uap.um.binder.*;
import com.yonyou.uap.um.runtime.*;
import com.yonyou.uap.um.lexer.*;
import com.yonyou.uap.um.widget.*;
import com.yonyou.uap.um.widget.UmpSlidingLayout.SlidingViewType;
import com.yonyou.uap.um.log.ULog;
import java.util.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.webkit.*;
import android.content.*;
import android.graphics.*;
import android.widget.ImageView.ScaleType;

public abstract class RefModelDialogActivity extends UMWindowActivity {

	protected UMWindow RefModelDialog = null;
protected XVerticalLayout viewPage0 = null;
protected UMLabel label0 = null;
protected UMListViewBase list_refinfos = null;
protected XHorizontalLayout panel0 = null;
protected UMLabel lbl_refinfodetail = null;
protected UMLabel label1 = null;

	
	protected final static int ID_REFMODELDIALOG = 1144606482;
protected final static int ID_VIEWPAGE0 = 1747999408;
protected final static int ID_LABEL0 = 238723001;
protected final static int ID_LIST_REFINFOS = 550124304;
protected final static int ID_PANEL0 = 1379012004;
protected final static int ID_LBL_REFINFODETAIL = 317245045;
protected final static int ID_LABEL1 = 1374208643;

	
	
	@Override
	public String getControllerName() {
		return "RefModelDialogController";
	}
	
	@Override
	public String getContextName() {
		return "";
	}

	@Override
	public String getNameSpace() {
		return "com.yonyou.ncmm_pac_pda";
	}

	protected void onCreate(Bundle savedInstanceState) {
		ULog.logLC("onCreate", this);
		super.onCreate(savedInstanceState);
        onInit(savedInstanceState);
        
	}
	
	@Override
	protected void onStart() {
		ULog.logLC("onStart", this);
		
		super.onStart();
	}

	@Override
	protected void onRestart() {
		ULog.logLC("onRestart", this);
		
		super.onRestart();
	}

	@Override
	protected void onResume() {
		ULog.logLC("onResume", this);
		
		super.onResume();
	}

	@Override
	protected void onPause() {
		ULog.logLC("onPause", this);
		
		super.onPause();
	}

	@Override
	protected void onStop() {
		ULog.logLC("onStop", this);
		
		super.onStop();
	}

	@Override
	protected void onDestroy() {
		ULog.logLC("onDestroy", this);
		
		super.onDestroy();
	}
	
	public  void onInit(Bundle savedInstanceState) {
		ULog.logLC("onInit", this);
		UMActivity context = this;
		registerControl();
		this.getContainer();
		
		/*
		 new Thread() {
			 public void run() {
				 UMPDebugClient.startServer();
			 }
		 }.start();
		*/
		String sys_debug = ApplicationContext.getCurrent(this).getValue("sys_debug");
		if (sys_debug != null && sys_debug.equalsIgnoreCase("true")) {
			UMPDebugClient.waitForDebug();
		}

		IBinderGroup binderGroup = this;
		currentPage = getCurrentWindow(context, binderGroup);
super.setContentView(currentPage);

		
	}
	
	private void registerControl() {
		  idmap.put("RefModelDialog",ID_REFMODELDIALOG);
  idmap.put("viewPage0",ID_VIEWPAGE0);
  idmap.put("label0",ID_LABEL0);
  idmap.put("list_refinfos",ID_LIST_REFINFOS);
  idmap.put("panel0",ID_PANEL0);
  idmap.put("lbl_refinfodetail",ID_LBL_REFINFODETAIL);
  idmap.put("label1",ID_LABEL1);

	}
	
	public void onLoad() {
		ULog.logLC("onLoad", this);
		if(currentPage!=null) {
			currentPage.onLoad();
		}
	
		{ //viewPage0 - action:viewpage0_onload
    UMEventArgs args = new UMEventArgs(RefModelDialogActivity.this);
    actionViewpage0_onload(viewPage0,args);

}

	}
	
	public void onDatabinding() {
		ULog.logLC("onDatabinding", this);
		super.onDatabinding();
		
	}
	
	@Override
	public void onReturn(String methodName, Object returnValue) {
		
	}

	@Override
	public void onAfterInit() {
		ULog.logLC("onAfterInit", this);
		
		onLoad();
	}
	
		@Override
	public Map<String,String> getPlugout(String id) {
		XJSON from = this.getUMContext();
		Map<String,String> r = super.getPlugout(id);
		
		return r;	
	}
	
	
	
	public View getPanel0View(final UMActivity context,IBinderGroup binderGroup) {
panel0 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_PANEL0
,"heightwrap","50.0"
,"border-bottom-color","#C7C7C7"
,"background","#FFFFFF"
,"ondoubletap","action:panel0_ondoubletap"
,"border-bottom-width","1"
,"width","fill"
,"valign","center"
,"layout-type","vbox"
,"halign","LEFT"
,"height","wrap"
);
lbl_refinfodetail = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LBL_REFINFODETAIL
,"bindfield","lbl_refinfodetail"
,"color","#000000"
,"heightwrap","50.0"
,"width","fill"
,"font-size","14"
,"font-family","default"
,"valign","top"
,"layout-type","hbox"
,"type","multiline"
,"halign","left"
,"height","wrap"
);
panel0.addView(lbl_refinfodetail);

return panel0;
}
public View getList_refinfosView(final UMActivity context,IBinderGroup binderGroup) {
list_refinfos = (UMListViewBase)ThirdControl.createControl(new UMListViewBase(context),ID_LIST_REFINFOS
,"layout","vbox"
,"bindfield","list_refinfos"
,"collapsed","true"
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"height","200"
);
list_refinfos.addListItemView("getPanel0View");

return list_refinfos;
}
public View getViewPage0View(final UMActivity context,IBinderGroup binderGroup) {
viewPage0 = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_VIEWPAGE0
,"background","#F7F8F8"
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"onload","action:viewpage0_onload"
,"height","fill"
);
label0 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL0
,"color","#000000"
,"heightwrap","20.0"
,"width","wrap"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","vbox"
,"halign","center"
,"widthwrap","30.0"
,"content","工厂"
,"height","wrap"
);
viewPage0.addView(label0);
View list_refinfos = (View) getList_refinfosView((UMActivity)context,binderGroup);
viewPage0.addView(list_refinfos);
label1 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LABEL1
,"color","#000000"
,"heightwrap","20.0"
,"width","wrap"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","vbox"
,"halign","center"
,"widthwrap","54.0"
,"content","共100条"
,"height","wrap"
);
viewPage0.addView(label1);

return viewPage0;
}
public UMWindow getCurrentWindow(final UMActivity context,IBinderGroup binderGroup) {
RefModelDialog = (UMWindow)ThirdControl.createControl(new UMWindow(context),ID_REFMODELDIALOG
,"canvaswidth","200"
,"orientation","vertical"
,"controller","RefModelDialogController"
,"valign","TOP"
,"type","dialog"
,"layout","vbox"
,"canvasheight","300"
,"namespace","com.yonyou.ncmm_pac_pda"
,"width","fill"
,"layout-type","linear"
,"halign","center"
,"height","fill"
);
View viewPage0 = (View) getViewPage0View((UMActivity)context,binderGroup);
RefModelDialog.addView(viewPage0);

return (UMWindow)RefModelDialog;
}

	
	public void actionPanel0_ondoubletap(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "panel0_ondoubletap";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.detail_ondoubletap()",UMActivity.getViewId(control),args);
}
public void actionViewpage0_onload(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "viewpage0_onload";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.viewPage0_onload()",UMActivity.getViewId(control),args);
}


}
